package com.adee.netty.codec;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

public class NettyServerHandler2 extends SimpleChannelInboundHandler<Object> {
    @Override
    protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
//        MyDataInfo.MyMessage.DataType tp = msg.getDataType();
//        if(tp == MyDataInfo.MyMessage.DataType.TeacherType) {
//            MyDataInfo.Teacher t = msg.getTeacher();
//            System.out.println("接收到客户端数据，name=" + t.getName() + ",id=" + t.getId());
//        } else {
//            MyDataInfo.Worker w = msg.getWorker();
//            System.out.println("接收到客户端数据，name=" + w.getName() + ",age=" + w.getAge());
//        }
    }
}
